package com.xianxing.gateway.log.task;

import com.xianxing.gateway.log.dao.RequestLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 每月删除数据库日志记录
 * @author 唐保罗
 * @version 1.0
 */
@Component
public class AutoDeleteLogs {

    @Autowired
    private RequestLogMapper requestLogMapper;

    @Scheduled(cron = "0/60 0 0 0 * ?")
    public void autoDeleteDBLogs(){
        requestLogMapper.deleteAllLogs();
    }
}
